package com.realtybaron.api;

import com.google.inject.Singleton;
import com.google.inject.name.Names;
import com.google.inject.servlet.ServletModule;

/**
 * User: marc Date: Feb 3, 2010 Time: 7:15:05 AM
 * <p/>
 * THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 * TECHNOLOGIES.
 */
public class AuctionWebModule extends ServletModule {
  @Override
  protected void configureServlets() {
    this.serve("/PostSeller.htm").with(PostSellerController.class);
    this.serve("/OpenAuction.htm").with(OpenAuctionController.class);
    this.serve("/ViewAuction.htm").with(ViewAuctionController.class);
    this.serve("/ViewInquiry.htm").with(ViewInquiryController.class);
    this.serve("/AnswerInquiry.htm").with(AnswerInquiryController.class);
    this.serve("/ViewBid.htm").with(ViewBidController.class);
    this.serve("/ListBids.htm").with(ListBidsController.class);
    this.serve("/SelectBid.htm").with(SelectBidController.class);
    this.bind(ViewResolver.class).to(DefaultViewResolver.class).in(Singleton.class);
    this.bind(String.class).annotatedWith(Names.named("prefix")).toInstance("");
    this.bind(String.class).annotatedWith(Names.named("suffix")).toInstance(".jsp");
    this.bind(String.class).annotatedWith(Names.named("apikey")).toInstance("6VJs82aPtJNbb34P");
    this.bind(String.class).annotatedWith(Names.named("apibase")).toInstance("http://api.realtybaron.com/auction/xml");
    this.bind(String.class).annotatedWith(Names.named("appbase")).toInstance("http://realtybaron-auction-api.appspot.com");
    this.bind(String.class).annotatedWith(Names.named("appname")).toInstance("realtybaron_auction_api");
  }
}
